package com.gxgy.common.controller;

import com.gxgy.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("/common/watermar")
public class WatermarkController {

    @Resource
    private RestTemplate restTemplate;


    @GetMapping
    public AjaxResult getWatermark(){

        String url = "http://111.230.246.128:10201/common/watermar";
        return restTemplate.getForObject(url, AjaxResult.class);
        //发送请求获取服务器结果

//        Map<String, Object> result = new HashMap<>();
//        result.put("text", "预览效果");
//        result.put("hide", false);
//        return AjaxResult.success(result);
    }

    @PostMapping("/disable/{app}")
    public AjaxResult getDisable(@PathVariable String app){
        String url = "http://111.230.246.128:10201/appdisable/" + app;
        return restTemplate.getForObject(url, AjaxResult.class);
    }


}
